package com.beans;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * User:xieChao
 * Date:2022/11/29 19:16
 */
@Component
public class UserBeans {
    @Bean(name = "u1")
    public User user1() {
        User user = new User();
        user.setUserId(11);
        user.setUserName("谢超");
        return user;
    }

    @Bean(name = "u2")
    public User user2() {
        User user = new User();
        user.getUserId();
        user.getUserName();
        return user;
    }
}
